const express = require("express");

const app = express();

app.set("secret", "xvcbvvccnbd45");

app.use(require("cors")());
app.use(express.json());
app.use("/uploads", express.static(__dirname + "/uploads"));
//开放uploads文件夹，让接口加上uploads就可以访问upload里面的图片
require("./plugins/db")(app);

// mounted service api
require("./routes/admin")(app);
require("./routes/web")(app);

app.listen(3001, () => {
  console.log("http://localhost:3001");
});
